package com.vcaresolution.logistic.dao;

import java.util.List;

import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.vcaresolution.logistic.pojo.Codetable;

/**
 * The <code>UserDAO</code> class is a DAO Associated to do various 
 * options at DAO level
 *
 * @author Dharam C. Gusai
 * @version 1.0
 * @since ShipSoft 1.0
 */
@Repository
public class CodetableDAO extends BaseDAO{

	@SuppressWarnings("unchecked")
	public List<Codetable> getCodetable(String formdescription) {
		
		//"select * from codetable where formname = "+formname+ " AND formdescription = "+formdescription;
		
		List<Codetable> codeTableList = sessionFactory.getCurrentSession()
				.createCriteria(Codetable.class)
				.add(Restrictions.eq("formdescription", formdescription))
				.list();
		
		return codeTableList;
	}
	
//	private User updateLastLoginDate(User user){
//		user.setLastlogindate(new Date(System.currentTimeMillis()));
//		update(user);
//		
//		return (User) findById(User.class, user.getUserid());
//	}
}
